<template>
	<sc-water-mark ref="wm" :text="waterMarkContent" :subtext="waterMarkSubtext" :showWater="waterMark=='1'">
		<el-main class="nopadding">
			<div id="pptx"></div>
		</el-main>
	</sc-water-mark>
</template>
<script>
import config from "@/config";
import tool from "@/utils/tool";
export default {
	components:{
	},
	data(){
		return {
			extName:this.$route.query.extName,
			attachId:this.$route.query.attachId,
			netDiskId:this.$route.query.netDiskId,
			isNetDisk:this.$route.query.isNetDisk,
			ppt: '',//设置文档地址
			waterMarkContent:'',
			waterMarkSubtext:'',
			waterMark:'0',
		}
	},
	methods:{
		rendered(){
			console.log("渲染完成")
		}
	},
	mounted() {
		this.waterMark = this.$TOOL.data.get("WATER_MARK");
		this.waterMarkContent = this.$TOOL.data.get("WATER_MARK_CONTENT");
		this.waterMarkSubtext = this.$TOOL.data.get("WATER_MARK_SUBTEXT");
		if(this.isNetDisk=='true')
		{
			if(config.SM4_PRIVATE_KEY!='')
			{
				this.ppt = config.API_URL+'/get/file/downNetDiskFile?netDiskId=' + tool.crypto.createParam(this.netDiskId) + "&fileName=" + tool.crypto.createParam(this.attachId);
			}else{
				this.ppt = config.API_URL+'/get/file/downNetDiskFile?netDiskId=' + this.netDiskId + "&fileName=" + encodeURIComponent(this.attachId);
			}
		}else {
			if(config.SM4_PRIVATE_KEY!='')
			{
				this.ppt = config.API_URL+"/get/file/getFileDown?attachId="+tool.crypto.createParam(this.attachId);
			}else{
				this.ppt = config.API_URL+"/get/file/getFileDown?attachId="+this.attachId;
			}
		}
		$("#pptx").pptxToHtml({
			pptxFileUrl: this.ppt, //pptx文件地址
			slidesScale: "50%",
		});
	}
}
</script>






